import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { HomeComponent } from './home.component';
import { Pag404Component } from '../pag404/pag404.component';
import { WelcomeComponent } from '../welcome/welcome.component';
import { LoginGuardGuard } from 'src/app/guard/login-guard.guard';
import { SysUserComponent } from './sys-user/sys-user.component';
import { SysMenuComponent } from './sys-menu/sys-menu.component';

const routes: Routes = [
  {
    path: 'home', component: HomeComponent,
    children: [
      { path: 'welcome', component: WelcomeComponent },
      { path: 'sys/user', component: SysUserComponent },
      { path: 'sys/menu', component: SysMenuComponent },
      { path: '**', component: Pag404Component },
    ],
    canActivate: [LoginGuardGuard]
  },
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
export class HomeRoutingModule { }
